package cn.ssm.biz.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import cn.ssm.biz.UserBiz;
import cn.ssm.dao.StudentMapper;
import cn.ssm.dao.UserMapper;
import cn.ssm.pojo.Pager;
import cn.ssm.pojo.User;
@Service("UBizImpl")
public class UserBizImpl implements UserBiz {
	@Autowired
	@Qualifier("userMapper")
	private UserMapper um;
	public UserMapper getUserMapper() {
		return um;
	}
	public void setUserMapper(UserMapper userMapper) {
		this.um = userMapper;
	}

	@Override
	public int addUsers(User u) {
		// TODO Auto-generated method stub
		return um.insertUsers(u);
	}

	@Override
	public int delUsers(int id) {
		// TODO Auto-generated method stub
		return um.deleteUsers(id);
	}

	@Override
	public int UpdateUsers(User u) {
		// TODO Auto-generated method stub
		return um.UpdateUsers(u);
	}

	@Override
	public User findUserslistByid(int id) {
		// TODO Auto-generated method stub
		return um.selectUserslistByid(id);
	}

	@Override
	public User findlogin(User u) {
		// TODO Auto-generated method stub
		return um.selectUserslist(u);
	}

	
	@Override
	public List<User> findUserList(Pager pager) {
		// TODO Auto-generated method stub
		int form =(pager.getCurrentPage()-1)*(pager.getRowPerPage());
		
		return um.selectUserslist2(form, pager.getRowPerPage());
	}
	@Override
	public int findUserCount() {
		// TODO Auto-generated method stub
		return um.selectUserCount();
	}
	@Override
	public List<User> selectUsersInfo1() {
		// TODO Auto-generated method stub
		return um.selectUsersInfo1();
	}


}
